import request from './request'

export default {
  // 登录
  login: (params) => request.post('/remote/api/user/login', params),

  // 获取配置项
  getConfig: (params) => request.post('/remote/api/config/get', params),

  // 获取汇率
  getXmPrice: (params) => request.get('/xmRemote/xm/price', params),

  // ---- 质押 ----
  pledge: {
    // 获取质押详情
    getDetails: (params) => request.post('/remote/api/record/contract', params),

    // 获取质押规则
    getRules: (params) => request.post('/remote/api/rules/order', params),

    // 获取质押订单
    getOrders: (params) => request.get(`/remote/api/record/orders`, params),
  },

  // ---- 市场 ----
  market: {
    // 获取代理规则
    getAgentRules: (params) => request.post('/remote/api/rules/agent', params),

    // 获取团队规则
    getTeamRules: (params) => request.post('/remote/api/rules/team', params),

    // 获取下级市场
    getMarkets: (params) => request.post('/remote/api/user/market', params),

    // 获取每日新增业绩
    getNews: (params) => request.post('/remote/api/market/team', params),
  },

  // ---- 收益 ----
  profit: {
    // 提现
    addWithdraw: (params) => request.post('/remote/api/withdraw/add', params),

    // 获取用户理财
    getProfits: (params) => request.post('/remote/api/record/profit', params),

    // 获取客户分红
    getAgents: (params) => request.post('/remote/api/record/agent', params),

    // 获取团队奖励
    getTeams: (params) => request.post('/remote/api/record/team', params),

    // 获取提现记录
    getWithdraws: (params) =>
      request.post('/remote/api/record/withdraw', params),

    // 获取股东收益
    getGudongWithdraw: (params) =>
      request.post('/remote/api/shareholder/index', params),

    // 股东提现收益
    addGudongWithdraw: (params) =>
      request.post('/remote/api/shareholder/cash', params),

    // 获取股东提现详情
    getGudongWithdraws: (params) =>
      request.post('/remote/api/shareholder/cashes', params),
  },

  // ---- 矿机 ----
  miner: {
    // 登录
    login: (params) =>
      request.post('/miner/mining/user/login', params, {
        ['Content-Type']: 'multipart/form-data',
      }),

    // 提现
    withdraw: (params) =>
      request.post('/miner/mining/withdrawalRecord/add', params),

    // 获取提现消耗算力
    getConsumePower: (params) =>
      request.post('/miner/mining/withdrawalRecord/getConsumePower', params, {
        ['Content-Type']: 'multipart/form-data',
      }),

    // 获取订单详情
    getDetails: (params) =>
      request.get('/miner/mining/orderInfo/detail', params),

    // 获取质押订单
    getOrders1: (params) =>
      request.get('/miner/mining/powerDetail/list', params),

    // 获取提现订单
    getOrders2: (params) =>
      request.get('/miner/mining/withdrawalRecord/list', params),
  },
}
